<template>
	<view class="serve_item">
		<view class="serve_l">
			<image :src="goodsItem.preview_img"
				mode="widthFix"></image>
		</view>
		<view class="serve_r">
			<view class="sr_t">
				<view class="sr_title">
					{{goodsItem.product_name || ''}}
				</view>
			</view>
			<view class="sr_m" v-if="goodsItem.sku_id != 0">
				<view class="sr_mtext">{{goodsItem.sku_name}}</view>
			</view>
			<view class="sr_m" v-if="goodsItem.member_msg">
				<text class="cart_huiy">{{goodsItem.member_msg || ''}}</text>
			</view>
			<view class="sr_b diFlex">
				<text class="cred">
					￥
					<text class="money_now">{{goodsItem.local_shop_price || ''}}</text>
					<text class="huaxian">￥{{goodsItem.market_price || ''}}</text>
				</text>
				<view class="goods-num">
					X{{goodsItem.number || ''}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "serveAdd",
		props:{
			goodsItem:{
				type:Object
			},
			isOrder:{
				type:Boolean,
				default:false
			},
			isDetail:{
				type:Boolean,
				default:false
			}
		},
		created() {
			console.log('子组件触发')
			console.log(this.goodsItem)
		},
		data() {
			return {
				 num:0
			}
		},

		methods: {
		
			toDetail() {

			}
		}
	}
</script>

<style lang="scss" scoped>
	$myfont-color:#292929;

	.cred {
		color: #f55535;
	}
	.cart_huiy{
		font-size: 12px;
		padding: 2px 5px;
		background: #fff2f2;
		color: #cf0000;
	}
	.huaxian{
		color: #999;
		font-size: 12px;
		padding-left: 5px;
	}
	@mixin ellipsis {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.serve_item {
		display: flex;
		border-radius: 10px;
		background-color: #fff;
		padding: 24rpx;
		margin-bottom: 12px;

		.serve_l {
			width: 105px;
			height: 86px;
			overflow: hidden;
			border-radius: 5px;

			image {
				height: 100%;
				width: 100%;
			}
		}

		.serve_r {
			padding-left: 10px;
			flex: 1;
			max-width: 235px;

			.sr_t {
				display: flex;
				align-items: center;

				.sr_title {
					font-size: 14px;
					color: $myfont-color;
					flex: 1;
				}

			}

			.sr_m {
				display: flex;
				margin-top: 12px;
				font-size: 12px;
				color: #666;
				align-items: center;

				.sr_xl {
					font-size: 10px;
					color: #999;
					margin-left: 12px;

					.xl_num {
						color: #e2ab09;
					}
				}

				.apm {
					width: 85px;
					height: 30px;
					border-radius: 15px;
					background: linear-gradient(90deg, #8d65e2, #4839ee);
					color: #fff;
					text-align: center;
					line-height: 30px;
				}

				.clock {
					// margin-left: 12px;
				}
			}

			.sr_b {
				margin-top: 8px;
				display: flex;
				align-items: center;
				.goods-num{
					font-size: 12px;
					color: #999;
					margin-left: 12px;
				}
				.money_now {
					font-size: 18px;
					font-weight: 700;
				}

				.money_ago {
					font-size: 10px;
					text-decoration: line-through;
					color: #999;
					margin-left: 4px;
					margin-right: 8px;
				}
				.minus {
						width: 17px;
						height: 17px;
						border-width: 1px;
						border-color: #724ce6;
						border-style: solid;
						border-top-left-radius: 100px;
						border-top-right-radius: 100px;
						border-bottom-left-radius: 100px;
						border-bottom-right-radius: 100px;
						display: flex;
						justify-content: center;
						align-items: center;
						text-align: center;
					}
				
					.input {
						padding: 0 10px;
					}
				
					.plus {
						width: 17px;
						height: 17px;
						background-color: #724ce6;
						border-radius: 50%;
						/* #ifndef APP-NVUE */
						display: flex;
						/* #endif */
						justify-content: center;
						align-items: center;
						border: 1px solid #724ce6;
					}
			}
		}
	}
	
</style>
